package com.xx.controller;

import com.xx.dto.OrderItemDTO;
import com.xx.entity.R;
import com.xx.service.IPurchaseordersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/purchaseorders")
public class PurchaseordersController {
    @Autowired
    IPurchaseordersService iPurchaseordersService;

    @PostMapping
    //生成订单
    public R createOrder(@RequestBody List<OrderItemDTO> orderItemDTOS){
        iPurchaseordersService.createOrder(orderItemDTOS);
        return R.success();
    }

}
